package C;

import java.util.Arrays;
import java.util.Scanner;

public class C74 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String[] line1 = sc.nextLine().split(" ");
        int n = Integer.parseInt(line1[0]),x = Integer.parseInt(line1[1]);
        int[] nums = Arrays.stream(sc.nextLine().split(" ")).mapToInt(Integer::parseInt).toArray();
        System.out.println(getResult(n,x,nums));

    }

    public static int getResult(int n,int x,int[] nums) {
        int[] sums = new int[n+1];
        //前缀和
        for (int i = 1; i < sums.length; i++) {
            sums[i] = sums[i-1]+nums[i-1];
        }
        //如果所有和都不满足大于等于x,直接返回0
        if (sums[n] < x) return 0;
        //如果是一个数，直接返回1
        if (n==1) return 1;

        //当存在两个数及以上时
        //7，8  x = 7  0 7 15
        int count = 0;
        for (int i = 0; i < sums.length; i++) {
            for (int j = i+1; j < sums.length; j++) {
                int sum = sums[j]-sums[i];
                if (sum>=x) {
                    count+= sums.length-j;
                    break;
                }
            }
        }



        return count;
    }
}
